//
//  JFNavigationBar.m
//  KaKa
//
//  Created by junFung on 15/12/17.
//  Copyright © 2015年 yc. All rights reserved.
//

#import "JFNavigationBar.h"

@implementation JFNavigationBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        for (UIView *view in self.subviews) {
            if ([view isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]) {
                self.navBarView = view;
            }
        }
    }
    return self;
}

- (void)show
{
    [UIView animateWithDuration:0.2 animations:^{
        self.navBarView.alpha  = 1.0;
    } completion:^(BOOL finished) {
        self.navBarView.hidden = NO;
    }];
}

- (void)hide
{
    self.navBarView.hidden = YES;
}

- (void)setNavAlpha:(CGFloat)navAlpha
{
    _navAlpha = navAlpha;
    self.navBarView.alpha = _navAlpha;
}
@end
